<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script>
</head>

<body>
    <div id="app" @click="handleClick">
        {{msg}}
    </div>
    <script>
        new Vue({
            el: "#app",
            data: {
                msg: "hello"
            },
            methods: {
                handleClick() {
                    /* vue中获取data中的数据 直接获取,不需要加data*/

                    console.log(this.msg) // this指的是 Vue new出来的实例
                    this.msg = "world"
                }
            }
        })
    </script>
</body>

</html>